<template>
  <div
    class="dialog"
    v-if="isShow"
  >
    <div class="dialog-main">
      <div class="dialog-title">{{ title }}</div>
      <div class="dialog-content">
        <slot></slot>
      </div>
      <div class="dialog-caozuo">
        <slot name="btn">
          <a
            style="color: #373E4F;float: left;border-right: 0.5px solid #E8EAF0"
            @click="doCancle"
          >取消</a>
          <a
            style="color: #0077FF;float: right"
            @click="doConfirm"
          >确定</a>
        </slot>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["title"],
  data() {
    return {
      isShow: false
    };
  },

  methods: {
    show() {
      this.isShow = true;
    },
    hidden() {
      this.isShow = false;
    },
    doCancle() {
      this.$emit("doCancle");
    },
    doConfirm() {
      this.$emit("doConfirm");
    }
  }
};
</script>

<style scoped>
.dialog {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 23, 50, 0.5);
  /* opacity: 0.5; */
  z-index: 99;
}
.dialog-main {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-width:80%;
  max-height:70%;
  padding: 40rpx;
  background-color: rgba(255, 255, 255, 1);
  border-radius: 25rpx;
  z-index: 100;
}

.dialog-title {
  flex: 0 0 auto;
  font-size: 28rpx;
  font-family: PingFang-SC-Bold;
  font-weight: bold;
  color: #373e4f;
  text-align: center;
}

.dialog-content {
  flex:1 1 auto;
  vertical-align: top;
   overflow-y: auto;
}

.content span {
  font-size: 11px;
  font-family: PingFang SC;
  font-weight: 500;
  color: #373e4f;
  line-height: 36px;
}

.content img {
  height: 25px;
  width: 25px;
  margin-right: 5px;
}

.dialog-caozuo {
  flex:0 0 auto;
  height: 40px;
  line-height: 40px;

}

.dialog-caozuo a {
  display: inline-block;
  width: 50%;
  font-size: 18px;
  font-family: PingFang SC;
  font-weight: 500;
  line-height: 50px;
  height: 40px;
  line-height: 40px;
  border-top: 0.5px solid #e8eaf0;
}
</style>
